<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link href="__PUBLIC__/admin/css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="__PUBLIC__/admin/css/normalize.css">
      <link rel="stylesheet" href="__PUBLIC__/admin/css/main.css">
      <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/2.2.1/css/bootstrap.min.css">
      <link rel="stylesheet" href="__PUBLIC__/admin/css/bootstrap-datetimepicker.min.css">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/html5shiv.js"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/js/action.js"></script>
    <script type="text/javascript" src="__PUBLIC__/plugins/xheditor/xheditor-1.2.1.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/plugins/xheditor/xheditor_lang/zh-cn.js"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/js/jCalendar.js"></script>
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    <script src="__PUBLIC__/admin/js/bootstrap-datetimepicker.min.js"></script>

    <style>
        <?php
            $width=round($img['width']*0.6+6);
            $height =round( $width*$img['height'] / $img['width']);
        ?>

        li {list-style-type:none;}
        .dx1{float:left; margin-left: 17px; margin-bottom:10px; }
        .dx2{color:#090; font-size:16px;  border-bottom:1px solid #CCC; width:100% !important; padding-bottom:8px;}
        .dx3{width:120px; margin:5px auto; border-radius: 2px; border: 1px solid #b9c9d6; display:block;}
        .dx4{border-bottom:1px solid #eee; padding-top:5px; width:100%;}
        .img-err {
            position: relative;
            top: 2px;
            left: 82%;
            color: white;
            font-size: 20px;
            border-radius: 16px;
            background: #c00;
            height: 21px;
            width: 21px;
            text-align: center;
            line-height: 20px;
            cursor:pointer;
        }
        .btn{
            height: 25px;
            width: 60px;
            line-height: 24px;
            padding: 0 8px;
            background: #24a49f;
            border: 1px #26bbdb solid;
            border-radius: 3px;
            color: #fff;
            display: inline-block;
            text-decoration: none;
            font-size: 13px;
            outline: none;
            -webkit-box-shadow: #666 0px 0px 6px;
            -moz-box-shadow: #666 0px 0px 6px;
        }
        .btn:hover{
            border: 1px #0080FF solid;
            background:#D2E9FF;
            color: red;
            -webkit-box-shadow: rgba(81, 203, 238, 1) 0px 0px 6px;
            -moz-box-shadow: rgba(81, 203, 238, 1) 0px 0px 6px;
        }
        .cls{
            background: #24a49f;
        }
        .txt-height,.txt-height input{
            height: 30px;
        }
    </style>

    <title>配置包机信息</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 定机管理 <span class="c-gray en">&gt;</span> 配置包机信息 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form class="form form-horizontal" action="?" method="post" onsubmit="return ac_from();" enctype="multipart/form-data">
       
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>出发地</label>
            <select onchange="startPlace(this)" name="start_place">
                <option>选择出发地</option>
                <?php foreach($data as $vr){ ?>
                <option value="<?php echo $vr['id']; ?>" data-id="<?php echo $vr['airport_name']; ?>" <if condition="$vr['id'] eq $pingji_xq['start_place']">selected="selected"</if> ><?php echo $vr['address']; ?></option>
                <?php } ?>
            </select>
            <!-- <div class="formControls col-xs-8 col-sm-3">{$pingji_xq.start_place}</div> -->
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>目的地</label>
            <select onchange="endPlace(this)" name="end_place">
                <option>选择目的地</option>
                <?php foreach($data as $vr){ ?>
                <option value="<?php echo $vr['id']; ?>" data-id="<?php echo $vr['airport_name']; ?>" <if condition="$vr['id'] eq $pingji_xq['end_place']">selected="selected"</if> ><?php echo $vr['address']; ?></option>
                <?php } ?>
            </select>
            <!-- <div class="formControls col-xs-8 col-sm-3">{$pingji_xq.end_place}</div> -->
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>出发时间</label><input type="text" id="startDate" name="start_time" placeholder="请点击选择出发时间" readonly class="form_datetime" style="width:10.6rem;border:0px;outline:none;" value="{$pingji_xq.start_time}">
            <!-- <div class="formControls col-xs-8 col-sm-3">{$pingji_xq.start_time}</div> -->
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>目的</label>
            <input type="radio" name="mudi" value="1" checked <if condition="$pingji_xq['mudi'] eq 1">checked</if>>商务
            <input type="radio" name="mudi" value="2" <if condition="$pingji_xq['mudi'] eq 2">checked</if> >旅行
            <input type="radio" name="mudi" value="3" <if condition="$pingji_xq['mudi'] eq 3">checked</if>>医疗
            <input type="radio" name="mudi" value="4" <if condition="$pingji_xq['mudi'] eq 4">checked</if>>度假
            <!-- <div class="formControls col-xs-8 col-sm-3">{$pingji_xq.mudi}</div> -->
        </div>       
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>机型</label>
            <div class="formControls col-xs-8 col-sm-3">
                <select class="inp_1 txt-height" name="feiji_type" id="feiji_type" style="width:150px;">
                    <option value="">选择机型</option>
                    <volist name="Feijidata" id="v">
                        <option value="{$v.id}" <if condition="$v.id eq $pingji_xq['feiji_type']">selected="selected"</if>>-- {$v.name}</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出发机场</label>
            <!--<div class="formControls col-xs-8 col-sm-3">
                 <select class="inp_1" name="start_airport" id="start_airport" style="width:150px;">
                    <option value="">选择机场</option>
                    <volist name="startdata" id="v">
                        <option value="{$v.id}" <if condition="$v.id eq $pingji_xq['start_airport']">selected="selected"</if>>-- {$v.airport_name}</option>
                    </volist>
                </select>
                
            </div> -->
            <span class="formControls col-xs-8 col-sm-3" id="start_place">{$pingji_xq.start_airport}</span>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>到达机场</label>
            <!-- <div class="formControls col-xs-8 col-sm-3">
                <select class="inp_1" name="end_airport" id="end_airport" style="width:150px;">
                    <option value="">选择机场</option>
                    <volist name="enddata" id="v">
                        <option value="{$v.id}" <if condition="$v.id eq $pingji_xq['end_airport']">selected="selected"</if>>-- {$v.airport_name}</option>
                    </volist>
                </select>
            </div> -->
            <span class="formControls col-xs-8 col-sm-3" id="end_place">{$pingji_xq.end_airport}</span>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出发航站楼</label>
            <div class="formControls col-xs-8 col-sm-3 txt-height">
                <input type="text" class="input-text" placeholder="出发航站楼" name="start_lou" id="start_lou" value="{$pingji_xq.start_lou}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>到达航站楼</label>
            <div class="formControls col-xs-8 col-sm-3 txt-height">
                <input type="text" class="input-text" placeholder="到达航站楼" name="end_lou" id="end_lou" value="{$pingji_xq.end_lou}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>金额</label>
            <div class="formControls col-xs-8 col-sm-3 txt-height">
                <input type="text" class="input-text" placeholder="金额" name="money" id="money" value="{$pingji_xq.money}">
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>飞行时长</label>
            <div class="formControls col-xs-8 col-sm-3 txt-height">
                <input type="text" class="input-text" placeholder="飞行时长" name="fei_time" id="fei_time" value="{$pingji_xq.fei_time}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>座位数</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-tex" placeholder="座位数" name="seat" id="seat" value="{$pingji_xq.seat}">
            </div>
        </div>
        <input type="hidden" name="id" value="<?php echo $pingji_xq.id ?>">
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" name="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                
            </div>
        </div>

       
    </form>
</div>
<link rel="stylesheet" href="__PUBLIC__/admin/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="__PUBLIC__/admin/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="__PUBLIC__/admin/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/product.js"></script>
<script charset="utf-8" src="__PUBLIC__/admin/kindeditor/kindeditor-all.js"></script>
<!--_footer 作为公共模版分离出去-->

<!-- KindEditor编辑器 开始 -->
<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="content"]', {
            cssPath : '__PUBLIC__/admin/kindeditor/plugins/code/prettify.css',
            uploadJson : '__PUBLIC__/admin/kindeditor/php/upload_json.php',
            fileManagerJson : '__PUBLIC__/admin/kindeditor/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
</script>
<!-- KindEditor编辑器 结束 -->

<script>
    function startPlace(id){
        var optionid = $(id).find('option:selected').attr('data-id');
        $('#start_place').html(optionid);
    }
    function endPlace(id){
        var optionid = $(id).find('option:selected').attr('data-id');
        $('#end_place').html(optionid);
    }
    function upadd(obj){
        //alert('aaa');
        $('#imgs_add').append('<div>&nbsp;&nbsp;<input type="file" style="width:160px;" name="files[]" /><a onclick="$(this).parent().remove();" class="btn cls" style="background:#D0D0D0; width:40px; color:black;"">删除</a></div>');
        return false;
    }

    function getcid(){
        var cateid = $('#cateid').val();
        $.post('{:U("getcid")}',{cateid:cateid},function(data){
            if(data.catelist!=''){
                var htmls = '<option value="">二级分类</option>';
                var cate = data.catelist;
                for (var i = 0; i<cate.length; i++) {
                    htmls += '<option value="'+cate[i].id+'">-- '+cate[i].name+'</option>';
                }
                $('#cid').html(htmls);
                $('#catedesc').html('&nbsp;&nbsp; * 必选项');
            }else{
                $('#cid').html('<option value="">二级分类</option>');
                $('#catedesc').html('&nbsp;&nbsp; * 该分类下还没有二级分类，请先添加');
            }
        },"json");
    }

    //图片删除
    function del_img(img,obj){
        var pro_id = $('#pro_id').val();
        if (confirm('是否确认删除？')) {
            $.post('{:U("img_del")}',{img_url:img,pro_id:pro_id},function(data){
                if(data.status==1){
                    $(obj).parent().remove();
                    return false;
                }else{
                    alert(data.err);
                    return false;
                }
            },"json");
        };
    }

    function ac_from(){

        var name=document.getElementById('name').value;
        var number=document.getElementById('number').value;
        var content = $('#content').val();
        
        if(name.length<1 || number.length<1 ){
            alert('必填项不能为空');
            return false;
        }

        // var cid=parseInt(document.getElementById("cid").value);
        // if(!cid){
        //     alert("请选择分类.");
        //     return false;
        // }

        //  var pid=parseInt(document.getElementById("shop_id").value);
        // if(isNaN(pid) || pid<1){
        // 	alert("请选择所属商家");
        // 	return false;
        // }

    }
    $("#feiji_type").change(function(){
        var feiji = $("#feiji_type").val();
        $.post('{:U("feiji_xq")}',{'feiji_id':feiji},function(data){           
            $("#seat").val(data.number);
        },'json');
        
    });

</script>
<script>
  //    表单提交
  var bool = false;
  function toSubmit(){
    var name = $('#reservationName').val();
    var mobile = $('#reservationPhone').val();
    var id = $('#reservationId').val();
//      $('form').submit(function(){
    if($("#endDate").val()==''){
      showMsg('请选择离店时间！');
      bool = false;
      return bool;
    }else{
      bool = true;
    }
    if(bool){
      var sdate = new Date($("#startDate").val());
      var edate = new Date($("#endDate").val());

    }
//      });
  }

  var obj ;
  // var id = ${roomId};
  // var sdate = new Date();
      var sdate = '2018-07-04';
  // $.post('../hotel/roomOrder',{id:id},function(data){
  //   if(data.code==1000){
  //     if(data.result.hotelOrder.leaveTime != undefined){
  //       if(data.result.hotelOrder.leaveTime.time > new Date().getTime()){
  //         sdate = new Date(data.result.hotelOrder.leaveTime.time);
  //       }
  //     }
  //   }

//  alert(sdate);
//     $.post('../hotel/reservatTime',{id:id},function(data){
//       obj = data.result;
        obj = ['2018-07-12','2018-07-13','2018-07-20'];//禁用日期可以从数据库查
      //    自定义格式
      $.fn.datetimepicker.dates['zdy'] = {
        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
        daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
        daysMin:  ["日", "一", "二", "三", "四", "五", "六"],
        months: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
        monthsShort: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
        today: "今天",
        format:"yyyy-mm-dd hh:ii:ss",
        titleFormat:"yyyy-mm-",
        weekStart:1,
        suffix: [],
        meridiem: ["上午", "下午"]
      };
      $('#startDate').datetimepicker({
        language:  'zdy',
        weekStart: 1,
        todayBtn:  1,
        autoclose: true,
        minuteStep: 1,
        startDate:sdate,
        minView:0,
        maxView:3,
        onRenderDay: function(date) {
          //            alert(date);
          var date1 = date.getFullYear()+'-'
            +(date.getMonth()<9?'0'+(date.getMonth()+1):date.getMonth()+1)
            +'-'
            +(date.getDate()<10?'0'+(date.getDate()-1):date.getDate()-1);
          // for(var o in obj){
          //   if(date1==obj[o]){
          //     return ['disabled'];
          //   }
          // }

        }
      }).on('changeDate', function(ev){
        //      alert($("#startDate").val());
        $('#endDate').datetimepicker('remove');
        $('#endDate').val('');
        var sdate=$("#startDate").val();
        var edate;
        for(var o in obj){
          if(new Date(sdate)<=new Date(obj[o])){
            var date = new Date(obj[o])
            var ndate = +date+24*60*60*1000;
            var leaveTime = new Date(ndate);
            edate = leaveTime.getFullYear()+'-'+(leaveTime.getMonth()+1)+'-'+leaveTime.getDate();

            break;
          }
        }
//          alert(edate);
        $('#endDate').datetimepicker({
          language:  'zdy',
          weekStart: 1,
          todayBtn:  1,
          autoclose: 1,
          startDate:sdate,
          endDate:edate,
          minView:2,
          maxView:3
        }).on('changeDate', function(ev){
          //                    alert(o+++"~~")
        });
      });
    // });
  // });
  $("#endDate").click(function(){
    if($("#startDate").val()!=''){

    }else{
      showMsg('请先选择入住时间！');
    }
  });

</script>
</body>
</html>